package com.pphh.demo.amqp;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.MessageProperties;

/**
 * Please add description here.
 *
 * @author huangyinhuang
 * @date 2019/3/27
 */
public class Helper {

    private final static Logger log = LoggerFactory.getLogger(Helper.class);

    public static void logMessageProperties(MessageProperties msgProps) {
        if (msgProps != null) {
            log.info("msg properties, appId = {}", msgProps.getAppId());
            log.info("msg properties, clusterId = {}", msgProps.getClusterId());
            log.info("msg properties, consumer queue = {}", msgProps.getConsumerQueue());
            log.info("msg properties, consumer tag = {}", msgProps.getConsumerTag());
            log.info("msg properties, delay = {}", msgProps.getDelay());
            log.info("msg properties, delivery mode = {}", msgProps.getDeliveryMode());
            log.info("msg properties, deliver tag = {}", msgProps.getDeliveryTag());
            log.info("msg properties, priority = {}", msgProps.getPriority());
            log.info("msg properties, received delivery mode = {}", msgProps.getReceivedDeliveryMode());
            log.info("msg properties, received delay = {}", msgProps.getReceivedDelay());
            log.info("msg properties, redelivered = {}", msgProps.getRedelivered());
        }
    }

}
